package com.ag.wsq.dao;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ag.bean.TbDetailShift;
import com.ag.dao.TbDetailShiftDAO;

public class DetailShiftDAO extends TbDetailShiftDAO {

	private static final Log log = LogFactory.getLog(DetailShiftDAO.class);

	public List<TbDetailShift> getDShiftById(String duId) {
		logger.info("打印出：duId----"+duId);
		log.debug("getting TbDetailShift by id: " + duId);
		try {
			String hql = "from TbDetailShift d "
					+ "where d.tbShiftType.psId in (select du.tbShiftType.psId from" +
							" TbDuty du where du.duId = ?)" ;
			List<TbDetailShift> instance =  (List<TbDetailShift>) getHibernateTemplate().find(hql,duId);
			logger.info("-------"+ instance);
			return  instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}
}
